
def number():
    a,b,c,d = 12,4.4,True,3+7j
    print(a,b,c,d)
    print(type(a))
    print(type(b))
    print(type(c))
    print(type(d))

def string():
    word='字符串'
    word1="字符串2"
    word2="""多行字符串，
    多行。。。"""
    word3=r"不转义字符串\n"
    print(word,word1,word2,word3)
    print("截取字符串：",word3[0:-1:2])

    input="i like the world"
    list=input.split(" ")
    print(list)
    s=",".join(list)
    print(s)

    #格式化输出
    for x in range(1,11):
        print(repr(x).rjust(2),repr(x*x).rjust(3),repr(x**3).rjust(4))

def list():
    t=[1,2.5,'hello world']
    print(t)
    t.insert(3,"a")
    print(t)


def tuple():
    tuple=(1,2.4,'world',[1,2,3,4,5])
    print(tuple)

def set_example():
    s={1,4.2,'this',('a','b')}
    print(s)
    s.add(1)
    print(s)

    set1=set((1,2,3,4))
    print(set1)
    subs=s - set1
    union=s | set1
    intersecion=s & set1
    print("差集：",subs)
    print("并集：",union)
    print("差集：",intersecion)

def dictionary():
    dict={}
    dict['name'] = "jason"
    dict['age'] = 25
    print(dict)
    print(dict['name'])

def bytes_example():
    b1=bytes
    b2=b''
    b3=b'http://baidu.com'
    print(b3)
    print(b3[0])


if __name__ == '__main__':
    # string()
    # list()
    # tuple()
    # set_example()
    # dictionary()
    # bytes_example()
    t1 = ("a",("123",1000))
    t2 = ("a",("123",1000))
    d = {("a",("123",1000)):"123",("a",("123",1000)):"345"}
    if(t1 == t2):
        print(True)
    else:
        print(False)
    print(d)
    print(d[t1])
    print(d[t2])